<template>
  <div>
    <bread></bread>
    <!-- 面包屑 -->
    <!-- <el-card class="box-card">
  
    </el-card> -->

   
   <el-table
    :data="rightsData"
    border
    style="width: 100%">
    <el-table-column
      type="index"
      label="#">
    </el-table-column>
    <el-table-column
      prop="authName"
      label="权限名称"
      width="180">
    </el-table-column>
    <el-table-column
      prop="path"
      label="路径">
    </el-table-column>
    <el-table-column
      prop="level"
      label="权限等级">
      <template slot-scope="scope">
          <el-tag v-if="scope.row.level==0" size="mini">一级</el-tag>
          <el-tag v-if="scope.row.level==1" type="success" size="mini">二级</el-tag>
          <el-tag v-if="scope.row.level==2" type="warning" size="mini">三级</el-tag>
      </template>
    </el-table-column>
  </el-table>
 
  </div>
</template>

<script>
 import rightsApi from "@/api/rights.js"
 import bread from '@/components/bread'
 export default {
    components:{
        bread
    },
    data() {
      return {
        rightsData:[] 
      }
    },
    created(){
      this.getRights()
    },
    methods:{
        getRights(){  //获取权限列表
          this.$axios.get('rights/list')
          .then(res=>{
            //   console.log(res.data)
            this.rightsData=res.data
          })

        }
    }
  }
</script>